<template>
	<view>
		<view class="jfPop">
			<view class="jfPopTit spaceBet">
				<view class="jfTit">积分抵扣<text class="remainTxt">(剩余{{totalJf}}积分)</text></view>
				<view class="iconfont icon-guanbi" @tap="closeJfPop"></view>
			</view>	
			<view class="jfPopCon">
				<view class="popItem spaceBet" @tap="selCurrJfType(0)">
					<view>暂不使用积分</view>
					<view class="itemRadCon">
						<view class="radView" :class="[currJfTypeIndex == 0 ? 'active' : '']"><view class="iconfont icon-duihao"></view></view>
					</view>
				</view>
				<view class="popItem spaceBet" @tap="selCurrJfType(1)">
					<view>抵扣<text class="dkPrice">¥{{dkPrice}}</text>使用{{dkJf}}积分</view>
					<view class="itemRadCon">
						<view class="radView" :class="[currJfTypeIndex == 1 ? 'active' : '']"><view class="iconfont icon-duihao"></view></view>
					</view>
				</view>
			</view>
			<view class="sureBtn">
				<button class="comBtn" @tap="sureSelCurrType">确定</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"use-jf-pop",
		props:{
			totalJf:Number,
			dkPrice:Number,
			dkJf:Number,
			currJfTypeIndex:Number
		},
		data() {
			return {
			};
		},
		methods:{
			openJfDkPop(){
				this.$emit('openJfDkPop');
			},
			selCurrJfType(index){
				this.$emit('switchUseJfType',index);
			},
			sureSelCurrType(){
				this.$emit('sureSelCurrType');
			},
			closeJfPop(){
				this.$emit('closeJfPop');
			}
		}
	}
</script>

<style lang="scss">
	.jfPop{
		padding:0 30rpx 0rpx;
		background: #fff;
		border-radius: 20rpx 20rpx 0 0;
		.sureBtn{
			padding: 20rpx 0;
			border-top: 1rpx solid #eee;
			display: flex;
			align-items: center;
			justify-content: center;
			.comBtn{
				width: 90%;
				border-radius: 50rpx;
				background: $pss-color-red;
			}
		}
		.jfPopCon{
			padding: 30rpx 0;
			.popItem{
				height: 90rpx;
				align-items: center;
				font-size: 30rpx;
				color: $pss-text-color3;
				.dkPrice{
					color: $pss-color-red;
					margin-right: 5rpx;
				}
				.notAllowt{
					font-size: 24rpx;
					margin-left: 10rpx;
					color: $pss-color-red;
				}
				.itemRadCon{
					width: 30%;
					height: 100%;
					display: flex;
					align-items: center;
					justify-content: flex-end;
					font-size: $font-size28; 
					.radView{
						width: 30rpx;
						height: 30rpx;
						line-height: 30rpx;
						border: 1rpx solid #eee;
						border-radius: 50%;
						color: #fff;
						text-align: center;
						margin-right: 10rpx;
						.icon-duihao{
							font-size: $font-size24;
						}
						&.active{
							border: 1rpx solid $pss-color-red;
							background: $pss-color-red;
						}
					}
					.radTit{
						color: $pss-text-color3;
						&.hasBold{
							font-weight: bold;
						}
					}
				}
			}
		}
		.jfPopTit{
			height: 90rpx;
			align-items: center;
			border-bottom: 1rpx solid #eee;
			color: $pss-text-color3;
			.jfTit{
				font-size: 38rpx;
				font-weight: bold;
				.remainTxt{
					margin-left: 10rpx;
					font-size: 26rpx;
					font-weight: normal;
				}
			}
			.icon-guanbi{
				width: 90rpx;
				height: 90rpx;
				line-height: 90rpx;
				text-align: right;
				font-size:50rpx;
				color: $pss-text-colora;
			}
		}
	}
</style>
